{% extends "sysadmin/sys_org_info_base.html" %}
{% load i18n seahub_tags %}


{% block right_panel %}
<div class="tabnav">
    <ul class="tabnav-tabs">
        <li class="tabnav-tab"><a href="{% url 'sys_org_info_user' org.org_id %}">{% trans "Members" %}</a></li>
        <li class="tabnav-tab"><a href="{% url 'sys_org_info_group' org.org_id %}">{% trans "Groups" %}</a></li>
        <li class="tabnav-tab tabnav-tab-cur"><a href="{% url 'sys_org_info_library' org.org_id %}">{% trans "Libraries" %}</a></li>
        <li class="tabnav-tab"><a href="{% url 'sys_org_info_setting' org.org_id %}">{% trans "Settings" %}</a></li>
    </ul>
</div>

{% if org_repos %}
    <table class="repo-list">
        <tr>
            <th width="4%"><!--icon--></th>
            <th width="31%">{% trans "Name" %}</th>
            <th width="25%">ID</th>
            <th width="25%">{% trans "Owner" %}</th>
            <th width="15%">{% trans "Operations" %}</th>
        </tr>
        {% for repo in org_repos %}
        <tr>
            {% if repo.encrypted %}
            <td><img src="{{MEDIA_URL}}img/lib/48/lib-encrypted.png" width="24" title="{% trans "Encrypted"%}" alt="{% trans "library icon" %}" /></td>
            {% else %}
            <td><img src="{{MEDIA_URL}}img/lib/48/lib.png" width="24" title="{% trans "Read-Write"%}" alt="{% trans "library icon" %}" /></td>
            {% endif %}
            <td>{{ repo.name }}</td>
            <td style="font-size:11px;">{{ repo.id }}</td>
            <td>
                {% if repo.owner %}
                <a href="{{ SITE_ROOT }}useradmin/info/{{ repo.owner }}/">{{ repo.owner}}</a>
                {% else %}
                --
                {% endif %}
            </td>
            <td>
                <div>
                <a href="#" data-url="{% url "sys_repo_delete" repo.id %}" data-target="{{ repo.name }}" class="repo-delete-btn op vh">{% trans "Delete" %}</a>
                </div>
            </td>
        </tr>
        {% endfor %}
    </table>
{% else %}
<div class="empty-tips">
<h2 class="alc">{% trans "This organization doesn't have any libraries" %}</h2>
</div>
{% endif %}

{% endblock %}

{% block extra_script %}
<script type="text/javascript">
{% include 'sysadmin/sys_org_set_quota_js.html' %}
addConfirmTo($('.repo-delete-btn'), {
    'title': "{% trans "Delete Library" %}",
    'con': "{% trans "Are you sure you want to delete %s ?" %}",
    'post': true
});
</script>
{% endblock %}
